Added caching feature
Fix problems with alpha and margins