Bug fixes, slight changes