add defensive and friendly tests