Fix compiler warnings and errors. Close #9