Add support for RVM. Small bug fixes.