Bug fixes, small changes