some simple bug fixes