Fixes two bugs

Fixes the following cases:
 * Element has no margin top
 * Fixed element height is less then window height