Changed epoch handling to work as expected