Some comments, code cleanup and fix for mac