Minor bug fixes, some stubs