Minor fixes, need testing.