BBC IA test - some code and style fixes