More fixes and cleanups #302