Fixed bug described in #85

Missing values were not properly handled - added na.omit() where applicable.