Fixed to TODO's (needs some extra testing though)