Fixed a few issues from the refactoring