Issues/32 illegal patch

Test and fix for IllegalArgumentException when applying a change.