Fix type coercion of empty strings to date (return null)

Reviewer: raymond
Fix unreachable code in layers

Reviewer: raymond
Reviewer: lisa