add support for constant refs fixes #155 - thanks @neonancho