starting unit tests, fixed some bugs in appkernel