Fixed namespace reference handling. Close #78