This should fix the "maximum recursion depth exceeded" error. #306