Fixed bugs in implementation of floating elements