some fixes

Still need to work out a few things