Fixed bugs in shield generator