Added build optimizations (@franciscofranco)