Various fixes and clean-up

Fixes 13 errors and cleans up some code as well

Signed-off-by: Chintan Shah <cgintan1998@gmail.com>