Fixed a few issues. Seems to work now