Your lighting looks like a connection or ground problem based on your statement that slamming the trunk made it go away.....
The P0335 means you need to replace the CPS before it fails completely....
If you have a CEL for the P0335 code and you successfully start the car normally more than 3 times the CEL will clear..... it has nothing to do with your gas tank....