Updated comments and before hook error behaviour