fixed a few issues found during testing