Fix issues with beginning and ending frames
merge Master