Fixed up entry code to dpt and ctl to stop crash on double call
Tests for fixing bug in match