Plovdiv 9

Fixed #9, #14  and laid the foundations for a fix to #13