Bug fixes and spelling