Small fixes and removal of a bad var