bug fixes in sparkR

Signed-off-by: Izhar ul Hassan <ezhaar@gmail.com>