partial implementation of issue 14

Signed-off-by: Mattias Andrée <maandree@operamail.com>