Many smaller fixes, should have been separate commits. Some refactoring of meerkat and popupbehavior, fixed a synchronization bug with meerkat animation