Fixed duration bug and added some more descriptive error messages