fixed some bugs and added forceTitles legend option