tests and fixes for derivations