fix and improve checking for required functions; cosmetics