Fix runtime exception and doing rough test