Fix bug in SGD

#1192 

Fix a "typo" that does not seems to have any bad effects. 

Add test case for empty monitoring datasets dictionary. This bug does not make it fail, but the empty dictionary seems worth testing.