Fix some spacing and function declarations