Fixes a few issues