Fixed HTML generation bug, added fallback.