Improved use of stamina, bug fixes