Small code changes

Just some small cleaning up and debugging.