Small bug fixes introduced with clean up