Updated to work with Nim 0.10