some fixes from the master himself