Changed default build to release and tidied up use of debugmode in build_behaviour.py