Made struct naming consistent and fix small bugs.