Fixes problems using Date object