Fixes for various errors I have been getting.. Most of the core appears to work now..