Removed debug code in favour of assert statement