more code & spec fixes