Incorperated bugfixes from oden