Fix minor bugs in ruby

Fix minor bugs and setup basic specs