Some bug fixes. Added some cluster support.