Comment code and minor bug fixes