Comments, cleanup, memory fixes