Plovdiv 9

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