Fix some more bugs and added more stubs