some fixes to magic carpet