Fixed a few issues