Merge changes from Alexander Rødseth <rodseth@gmail.com>