Clean up namespace lookup, #651