some auto reformat
avoid some notices
added support for unit tests