Added support for multiple categories
Fixed some trivial conflict