initial ruby support / misc bug fixes