Bug fixes for score calcuation.

Also includes rudimentary memory usage logging.