Project cleanup, bugs fixed