Trying to merge kroltan's changes into my fork...