Fix some bugs with the ability system.