fix issue 76
fix issue 20
fix issue 21
fix issue 33 and build test