T7: Better error checking for function declarations