simplify adaptModTime (a bit)
fix is.defined function calls