Same bug as last commit had more opportunites. Fixed them and added a few comments.