Fixed block render issues
Cleaned up code