Misc changes, fixed compile error