fixed syntax errors and compiler warnings in new branch