Fixed the following issues:

#302
#308
#311
#312
#315
#322
#323
#327
#335