Fixes #164. Fixes #168. Fix for LP:#1262362